package com.dz.finance.api;

import com.dtflys.forest.springboot.annotation.ForestScan;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.util.AntPathMatcher;

/**
 * @author: DengHaoQi
 * @date: 2024/5/19 10:46
 * @description: 启动类
 */

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@ComponentScan("com.dz.finance")
@MapperScan("com.dz.finance.**.mapper")
@ForestScan(basePackages = {"com.dz.finance.common.service","com.dz.finance.wechat.service"})
public class FinanceAdminApiApplication {
    public static void main(String[] args) {
        SpringApplication.run(FinanceAdminApiApplication.class,args);
    }

    /*
     * 密码加密
     * */
    @Bean
    PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Bean
    public AntPathMatcher antPathMatcher() {
        return new AntPathMatcher();
    }
}
